# store datasets without imputations
ug1_no_imp <- ug1
ug2_no_imp <- ug2
ug3_no_imp <- ug3

# impute outcomes uganda 1
ug1$police_satisfactory <- impute_via_bootstrap("police_satisfactory", data = ug1)
ug1$support_mob_driver <- impute_via_bootstrap("support_mob_driver", data = ug1)

# impute outcomes uganda 2
ug2$police_satisfactory <- impute_via_bootstrap("police_satisfactory", data = ug2)
ug2$support_mob_driver <- impute_via_bootstrap("support_mob_driver", data = ug2)


# impute outcomes uganda 3

# here this question was not asked for everyone!
ug3$police_not_bribe[ug3$state_capacity_prime ==1] <- impute_via_bootstrap("police_not_bribe", 
                                                                           data = filter(ug3, state_capacity_prime ==1))
ug3$demand_mobs_binary <- impute_via_bootstrap("demand_mobs_binary", data = ug3)
ug3$punish_then_and_there <- impute_via_bootstrap("punish_then_and_there", data = ug3)
ug3$more_severe_punishment <- impute_via_bootstrap("more_severe_punishment", data = ug3)

ug3$mob_could_happen <- impute_via_bootstrap("mob_could_happen", data = ug3)

ug3$mob_violence_plausibility <- impute_via_bootstrap("mob_violence_plausibility", data = ug3)


